//
//  DBSEndEditingPanGestureController.m
//  DaBaiSite
//
//  Created by Mac-Mini-KingVision on 15/12/23.
//  Copyright © 2015年 admin. All rights reserved.
//

#import "LYEndEditingPanGestureController.h"
#import "UIGestureRecognizer+BlocksKit.h"
#import <ReactiveCocoa.h>
@implementation LYEndEditingPanGestureController

-(void)setTargetView:(UIView *)targetView
{
    _targetView = targetView;
    @weakify(self);
    UIPanGestureRecognizer *panGesture = [UIPanGestureRecognizer bk_recognizerWithHandler:^(UIGestureRecognizer *sender, UIGestureRecognizerState state, CGPoint location) {
        @strongify(self);
        [self.targetView endEditing:YES];
    }];
    panGesture.delegate = self;
    [_targetView addGestureRecognizer:panGesture];
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

@end
